package ldk.fakewifi.ui;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import ldk.fakewifi.R;

/**
 * Created by ldkxingzhe on 2016/10/24.
 */
public class MainActivity extends AppCompatActivity{
    @SuppressWarnings("unused")
    private static final String TAG = "AppCompatActivity";

    private RecyclerView mRecyclerView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mRecyclerView = (RecyclerView) findViewById(R.id.list);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView.setAdapter(new AppAdapter());
    }

    private static class AppAdapter extends RecyclerView.Adapter<AppViewHolder> {

        @Override
        public AppViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View rootView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_application, parent, false);
            return new AppViewHolder(rootView);
        }

        @Override
        public void onBindViewHolder(AppViewHolder holder, int position) {

        }

        @Override
        public int getItemCount() {
            return 100;
        }
    }

    private static class AppViewHolder extends RecyclerView.ViewHolder{
        public AppViewHolder(View itemView) {
            super(itemView);
        }
    }
}
